package com.wanmait.schedule.config;

import com.aliyun.oss.OSSClient;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.swing.*;


@Configuration
public class OssClientConfig {

    @Value("${spring.cloud.alicloud.oss.endpoint}")
    public String endpoint;
    @Value("${spring.cloud.alicloud.access-key}")
    public String accessKeyId;
    @Value("${spring.cloud.alicloud.secret-key}")
    public String accessKeySecret;

    @Bean
    public OSSClient createOssClient() {
        return (OSSClient)new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
    }

}
